<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增项目')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-user-add" class="form-horizontal">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required ">设备id：</label>
                    <div class="col-sm-8">
                        <input name="device_id" placeholder="请输入设备id" autocomplete="off" class="form-control" type="text" maxlength="30"
                               required >
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">设备名称：</label>
                    <div class="col-sm-8">
                        <input name="device_name" placeholder="请输入设备名称" class="form-control"autocomplete="off" type="text" maxlength="30"
                               required>
                    </div>
                </div>
            </div>

        </div>
        <div class="row">

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">设备类型：</label>
                    <div class="col-sm-8">
                        <input id="device_type" name="device_type" placeholder="请输入设备类型" class="form-control" autocomplete="off"
                               type="text" maxlength="30" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label ">作业id：</label>
                    <div class="col-sm-8">
                        <input id="job_id" name="job_id"class="form-control" placeholder="请输入仓库地址"autocomplete="off"  type="text"
                               maxlength="30" >
                    </div>
                </div>
            </div>

        </div>
        <div class="row">

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label ">开始时间：</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" placeholder="请单击选择开始时间：" name="start_time" id="startTime"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label ">结束时间：</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" placeholder="请单击选择结束时间：" name="finish_time" id="finishTime"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
        </button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script>
    layui.use('laydate', function(){
        var laydates = layui.laydate;
        laydates.render({
            elem: '#startTime'
            ,type: 'datetime',
            /* ,range: '到' */
            format: 'yyyy-MM-dd HH:mm:ss'
        })
    })

    layui.use('laydate', function(){
        var laydates = layui.laydate;
        laydates.render({
            elem: '#finishTime'
            ,type: 'datetime',
            /* ,range: '到' */
            format: 'yyyy-MM-dd HH:mm:ss'
        })
    })
    var prefix = ctx + "device/basDeviceRecord";

    function submitHandler() {

        if ($.validate.form()) {
            var data = $("#form-user-add").serializeArray();
            $.operate.saveTab(prefix + "/add", data);
        }
    }
</script>
</body>
</html>